package com.qianfeng.sks.findingfood;

import android.support.v4.app.Fragment;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import android.widget.RadioGroup;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ContentView;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.qianfeng.sks.findingfood.fragment.CatoryFragment;
import com.qianfeng.sks.findingfood.fragment.HomeFragment;
import com.qianfeng.sks.findingfood.fragment.KitchenFragment;
import com.qianfeng.sks.findingfood.fragment.MineFragment;
import com.qianfeng.sks.findingfood.utils.FragmentTabUtils;
import java.util.ArrayList;
@ContentView(R.layout.activity_main)
public class MainActivity extends AppCompatActivity implements FragmentTabUtils.OnRgsExtraCheckedChangedListener {
    @ViewInject(R.id.feeding_bottom_btn)
    private RadioGroup group;
    private ArrayList<Fragment> fragments = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ViewUtils.inject(this);
        fragments.add(new HomeFragment());
        fragments.add(new CatoryFragment());
        fragments.add(new KitchenFragment());
        fragments.add(new MineFragment());
        new FragmentTabUtils(getSupportFragmentManager(), fragments, R.id.feeding_frame_layout, group)
                .setOnRgsExtraCheckedChangedListener(this);

    }

    @Override
    public void OnRgsExtraCheckedChanged(RadioGroup radioGroup, int checkedId, int index) {

    }
}
